home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / system / int24.zip / INT24HND.ASM < prev    next >
Assembly Source File  |  1986-02-19  |  1KB  |  47 lines

  1. Comment *
  2. ┌────────────────────────────────────────────────────────────────────────────┐
  3. │ Title   : int24hnd                                 │
  4. │ Purpose : This procedure is an interrupt handler which installed, bypasses │
  5. │        the abort retry ignore messages and returns the error code to    │
  6. │        the program using the Inter program communications area at         │
  7. │        0x40:0xF0. See the dos tech reference manual for details about   │
  8. │        how this works.                             │
  9. │                                         │
  10. │    Written by Jack Zucker - 75766,1336    301-794-5950             │
  11. └────────────────────────────────────────────────────────────────────────────┘
  12.  *
  13.     assume cs:_text
  14. _text    segment public byte 'code'
  15.     public _int24hnd,_int24error
  16.  
  17. _int24hnd  proc near
  18.                 ; at this point, the first 3 words on the
  19.                 ; stack are:
  20.                 ; IP,CS,Flags as a result of the Failed
  21.                 ; dos call.
  22.  
  23.     add sp,06h;        ; Discard dos stack info
  24.  
  25.     mov cs:error,di        ; save error in code segment
  26.  
  27.     pop ax            ; pop all registers
  28.     pop bx
  29.     pop cx
  30.     pop dx
  31.     pop si
  32.     pop di
  33.     pop bp
  34.     pop ds
  35.     pop es
  36.                 ; Now whats left on the stack is:
  37.                 ; IP,CS,Flags of the guy who called
  38.                 ; the dos interrupt in the first place
  39.                 ; so lets return to him !
  40.  
  41.     iret            ; return to who called the int 21h
  42. _int24error    label far
  43. error    dw    0
  44. _int24hnd  endp
  45. _text    ends
  46. end
  47.